/**
 * @file gui_task.h
 * @author ThomasKingFree (dulu150@126.com)
 * @brief
 * @version 0.1
 * @date 2021-03-14
 *
 * @copyright Copyright (c) 2021
 *
 */

#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

#include "SDL.h"

namespace YueGUI {
namespace Simulator {
constexpr int16_t SIMULATOR_WIDTH = 400;
constexpr int16_t SIMULATOR_HEIGHT = 400;

constexpr int16_t RENDER_PERIOD = 30;

class GUIMonitor {
public:
    GUIMonitor();
    ~GUIMonitor();

    void Init();

    void Render();

    static int TaskEntry(void *param);

private:
    SDL_Window *window_;
    SDL_Renderer *renderer_;
    SDL_Texture *texture_;
    uint32_t *framebuffer_;
    volatile bool refresh_;
    static GUIMonitor *monitor_;
};
} // namespace Simulator
} // namespace YueGUI
